﻿using Iesi.Collections.Generic;
using NHibernate.Validator.Constraints;
using TestBat.IModels.Domain;

namespace TestBat.Models.Domain
{
    public abstract class TaskFolder : DomainEntity, ITaskFolder
    {
        /// <summary>
        /// constructor
        /// </summary>
        public TaskFolder()
        {
            Children = new HashedSet<ILeafTaskFolder>();
            Tasks = new HashedSet<ITask>();
        }

        /// <summary>
        /// the folder's name
        /// </summary>
        [NotEmpty]
        [Length(255)]
        public virtual string Name { get; set; }

        /// <summary>
        /// the associated tasks
        /// </summary>
        public virtual ISet<ITask> Tasks { get; private set; }

        /// <summary>
        /// the children-folder
        /// </summary>
        public virtual ISet<ILeafTaskFolder> Children { get; private set; }
    }
}
